package com.atguigu.gulimall.seckill.web;

import com.atguigu.gulimall.seckill.service.SeckillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @Autowired
    private SeckillService seckillService;

    @GetMapping("/up")
    @ResponseBody
    public String up(){
        try {
            seckillService.upLast3DaysSeckillProduct();
            return "success";
        } catch (Exception e) {
            e.printStackTrace();
            return "error";
        }
    }

}
